﻿using Forum.Entity.CodeFirst.model;
using SqlSugar;

namespace Forum.Entity.CodeFirst.model
{
    /// <summary>
    /// 博客文章
    /// </summary>
    [SugarTable("Post")]
    public class Post
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]

        public int Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 文章状态，提取原markdown文件的文件名前缀，用于区分文章状态，例子如下
        /// <para>《（未完成）StarBlog博客开发笔记(3)：模型设计》</para>
        /// <para>《（未发布）StarBlog博客开发笔记(3)：模型设计》</para>
        /// </summary>
        public string? Status { get; set; }

        /// <summary>
        /// 是否发表（不发表的话就是草稿状态）
        /// </summary>
        public bool IsPublish { get; set; }

        /// <summary>
        /// 梗概
        /// </summary>
        public string? Summary { get; set; }

        /// <summary>
        /// 内容（markdown格式）
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 博客在导入前的相对路径
        /// <para>如："系列/AspNetCore开发笔记"</para>
        /// </summary>
        public string? Path { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }

        /// <summary>
        /// 上次更新时间
        /// </summary>
        public DateTime LastUpdateTime { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        public int CategoryId { get; set; }

        /// <summary>
        /// 分类
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public Category? Category { get; set; }

        public string? Categories { get; set; }
    }
}